load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "traceevent",
    srcs = [
        "adapter.go",
        "flightrecorder.go",
        "traceevent.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/util/traceevent",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/logutil",
        "//pkg/util/tracing",
        "@com_github_tikv_client_go_v2//trace",
        "@org_uber_go_zap//:zap",
        "@org_uber_go_zap//zapcore",
    ],
)

go_test(
    name = "traceevent_test",
    timeout = "short",
    srcs = [
        "flightrecorder_test.go",
        "integration_test.go",
        "traceevent_test.go",
    ],
    embed = [":traceevent"],
    flaky = True,
    deps = [
        "//pkg/config",
        "//pkg/config/kerneltype",
        "//pkg/keyspace",
        "//pkg/kv",
        "//pkg/session",
        "//pkg/testkit",
        "//pkg/util/logutil",
        "//pkg/util/tracing",
        "@com_github_stretchr_testify//require",
        "@com_github_tikv_client_go_v2//trace",
        "@org_uber_go_zap//:zap",
    ],
)
